const joi = require("joi");

const page = joi.number().min(1).required();
const type_id = joi.number().min(1).required();
const id = joi.number().min(1).required();
const name = joi.string().pattern(/^[\S]{1,12}$/).required();

const get_list_schema = {
  query: {
    page,
  }
}

const get_byName_schema = {
  query: {
    name,
    page,
  }
}

const get_byListId_schema = {
  query: {
    page,
    type_id,
  }
}

const get_byId_schema = {
  query: {
    id,
  }
}

module.exports = {
  get_list_schema,
  get_byName_schema,
  get_byListId_schema,
  get_byId_schema,
}